<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>::: Motul rewards :::</title>
<link href="{$php5WebPathAD}/templates/css/main.css" rel="stylesheet" type="text/css" />
<link href="{$php5WebPathAD}/templates/css/menu.css" rel="stylesheet" type="text/css" />
<script src="{$php5WebPath}/includes/js/jquery/jquery.js" type="text/javascript"></script>
<script src="{$php5WebPath}/includes/js/global.js" type="text/javascript"></script>
<script src="{$php5WebPath}/includes/js/jquery/ajaxfileupload.js" type="text/javascript"></script>
{literal}
<script>

function ajaxFileUpload(path_image, folder)
{
  var frm, btn;
  frm = document.frmNews;
  btn = frm.btnUpload;
  btn.disabled = true;
  btn.value = 'Uploading...';
  $.ajaxFileUpload
  (
      {
          url: frm.url.value,
          secureuri:false,
          folder:folder,
          fileElementId:'file1',
          dataType: 'json',
          success: function (data, status)
          {
              if(typeof(data.error) != 'undefined')
              {
                  if(data.error != '')
                  {
                      btn.disabled = false;
                      alert(data.error);
                  }
                  else
                  {
                      //alert(data.msg);
                      btn.disabled = false;
                      id = document.getElementById("imagehtml");
                      if(id) {
                        id.innerHTML = "<img src='"+ path_image + "/" + folder + "/" + data.msg + "' width=50 height=50 />  <input type='button' name='btnDel' onclick='delImg();' value='DELETE' class='button_class'  />";
                      }
                      frm.photo.value=folder + "/" +data.msg;
                      alert('Upload file successfully!');
                  }
              }
              btn.value = 'Upload';
          },
          error: function (data, status, e)
          {
              btn.disabled = false;
              btn.value = 'Upload';
              alert(e);
          }
      }
  )
  
  return false;

}
function delImg(){
	document.getElementById("imagehtml").innerHTML = '';
	document.frmNews.photo.value = '';
}
</script>
{/literal}
<script language="javascript">
$(document).ready(function() {ldelim}		 
	// Validation	
	$('input#btn_submit').click(function() {ldelim}		   
	   var oEditor = FCKeditorAPI.GetInstance('short_description');	  
	   var oEditor1 = FCKeditorAPI.GetInstance('description');	   
	   
	   if ($('input#title').val()==''){ldelim}
		   alert('{$_MSS_NEWS_TITLE}');
		   $('input#title').focus();
		   return false;
	  {rdelim} else if (oEditor.GetXHTML()==''){ldelim}
		   alert('{$_MSS_NEWS_S_DESC}');
		   oEditor.Focus();
		   return false;
	   {rdelim}  else if (oEditor1.GetXHTML()==''){ldelim}
		   alert('{$_MSS_NEWS_DESC}');
		   oEditor1.Focus();
		   return false;
	   {rdelim} else {ldelim}
		   $('form#frmNews').submit();		   
	   {rdelim}
	{rdelim});
{rdelim});
</script>
</head>
<body>

{include_php file="$php5RootAdminPath/modules/main/header.php"}
<div style="padding:10px;">
            <div class="header"><span class="pathway">HOME &gt; </span> {$_NEWS}: #{$row->id}</div>           
           <div class="outer-form">      
           <table width="100%" border="0" cellspacing="1" cellpadding="5" class="table_form">          
               <tr>
                 <td align="right">&nbsp;</td>
                 <td align="right">
                 {if $allow_testimonials}
                 <input type="button" value="{$_UPDATE}" class="button_class" onclick="redirectToUrl('{$link_edit_testimonials}{$row->id}')"/>&nbsp;
                 {/if}
                 <input type="button" value="{$_BACK}" class="button_class" onclick="redirectToUrl('{$link_list_testimonials}')"/></td>
               </tr>
               <tr>
                 <td width="150" align="right"><strong>{$_CATEGORY}</strong></td>
                 <td>{$cat_name}</td>
               </tr>
               <tr>
                 <td width="150" align="right"><strong>{$_TITLE}</strong></td>
                 <td>{$row->title}</td>
               </tr>
               <tr>
                 <td align="right" valign="top"><strong>{$_IMAGE}</strong></td>
                 <td>                
            {if $row->image}
           <img src="{$php5WebPath}/images/{$row->image}" width=50 height=50 />			
           {/if}
                 </td>
               </tr>
               <tr>
                 <td width="150" align="right" valign="top"><strong>{$_SHORT_DESCRIPTION}</strong></td>
                 <td valign="top">{$row->short_description}</td>
               </tr>
               <tr>
                 <td width="150" align="right" valign="top"><strong>{$_CONTENT}</strong></td>
                 <td valign="top">{$row->description}</td>
               </tr>
               <tr>
                 <td width="150" align="right"><strong>{$_HIGHTLIGHT}</strong></td>
                 <td>{if $row->hot_news}
                     {$_YES}
                     {else}
                     {$_NO}
                     {/if}
                 </td>
               </tr>
               <tr>
                 <td width="150" align="right"><strong>{$_PUBLISHED}</strong></td>
                 <td>{if $row->publish==1}{$_YES}{/if}
                  {if $row->publish==0}{$_NO}{/if}
                </td>
               </tr>               
             </table>
</div>
         </div>    
 {include_php file="$php5RootAdminPath/modules/main/footer.php"}  
</body>
</html>
